﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Common
{
    public static class SysColor
    {
        public static Dictionary<short, Color> Colors = new Dictionary<short, Color>();
        public static void Load()
        {
            if (Colors.Count > 0)
                return;
            OledbUtil db = new OledbUtil(@"\GameData\Common\CommonData.mdb");
            DataTable tb = db.GetDataTable("Select * From Color");
            for (int i = 0; i < tb.Rows.Count; i++)
            {
                DataRow dr = tb.Rows[i];
                short id = Convert.ToInt16(dr["ID"]);
                Color item = new Color();
                item.PackedValue = uint.Parse(dr["Code"].ToString());
                Colors.Add(id, item);
            }
        }
    }
}
